<template>
	<view class="mainbgc">
		<view class="mainpadding2">
			<view class="mainpadding ffffff radius flexbetween margin_top" @click="tzwdjj(0)">
				<view class="">
					<view class="flexleft">
						<view class="jiangjin margin_right1"></view>
						<view class="ershil">余额</view>
					</view>
					<view class="cdtext margin_top">{{userInfo.money || "0.00"}}</view>
				</view>
				<view class="ckbtn">查看</view>
			</view>
			<view class="mainpadding ffffff radius flexbetween margin_top" @click="tzwdjj(1)">
				<view class="">
					<view class="flexleft">
						<view class="jifen margin_right1"></view>
						<view class="ershil">积分</view>
					</view>
					<view class="cdtext margin_top">{{userInfo.score || 0}}</view>
				</view>
				<view class="ckbtn">查看</view>
			</view>
		</view>
		
	</view>
</template>

<script>
const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				userInfo:{}
			}
		},
		onShow() {
			 this.init()
		},
		methods: {
		  	init() {
				httpRequest.request('/api/user/index', 'GET', {}, false, false, true).then(res => {
					if (res.code == 1) {
						this.userInfo = res.data
					}
				}).catch(err => {
					httpRequest.toast(err.msg)
				})
			},
			// 跳转我的余额页面
			tzwdjj(value) {
				uni.navigateTo({
					url: '/pages/mypage/yue?type='+value
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.mainbgc{
		overflow: hidden;
	}
	.ckbtn {
		width: 118rpx;
		height: 64rpx;
		font-size: 26rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #228DFF;
		border-radius: 32rpx;
		border: 3rpx solid #228DFF;
	}

	.cdtext {
		font-size: 38rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}

	.jifen {
		width: 31rpx;
		height: 31rpx;
		background-size: 100% 100%;
		background-image: url('@/static/images/system/jf.png');
	}

	.jiangjin {
		width: 39rpx;
		height: 39rpx;
		background-size: 100% 100%;
		background-image: url('@/static/images/system/jj.png');
	}

	.ershil {
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}

	.wushi {
		width: 40%;
	}

	.heisetext {
		font-size: 34rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: #000000;
	}

	.huisetext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
	}
</style>
